//
//  UserConfigManager.m
//  DogeLegs
//
//  Created by 宋华 on 2017/8/16.
//  Copyright © 2017年 宋华. All rights reserved.
//

#import "UserConfigManager.h"
#import "NoteCateoryMode.h"

@implementation UserConfigManager

+ (UserConfigManager *)shareInstance {
    static UserConfigManager *sharedInstance = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        sharedInstance = [[self alloc] init];
    });
    return sharedInstance;
}

#pragma mark  -网络请求
- (void)requestUserConfig {
    //请求配置接口,然后发通知，目前是GuideViewCtrl里的url要从这里拿
    
    [NSNotificationCenter postGetUserConfigDoneNotification:nil];
}

#pragma mark - getter
- (NSString *)guideUrl {
    return @"https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1503500456&di=9bec50d864f6259567a07fd88a60611f&imgtype=jpg&er=1&src=http%3A%2F%2Fimg.r1.market.hiapk.com%2Fdata%2Fupload%2F2014%2F09_25%2F4%2F201409250424519735.jpg";
}

-  (NSMutableArray *)cateoryArrs {
    if (_cateoryArrs == nil) {
        _cateoryArrs = [NSMutableArray array];
        [self testCatData];
    }
    return _cateoryArrs;
}

- (void)testCatData {
    for (NSInteger i = 0; i< 20; i++) {
        NoteCateoryMode *catMode = [[NoteCateoryMode alloc] init];
        catMode.cateoryName = [NSString stringWithFormat:@"cateory%ld",(long)i];
        catMode.cateoryid = [NSString stringWithFormat:@"%ld",(long)i];
        [self.cateoryArrs addObject:catMode];
    }
}

@end
